<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组索引</title>
    <script>
        var arr = [2,4,5,1,5,6]
        console.log(arr.indexOf(5)); // 2 从前面开始查找 只返回第一个满足的索引号 找不到则返回-1
        console.log(arr.lastIndexOf(5)); //4 从后面开始查找 只返回第一个满足的索引号 找不到则返回-1
    </script>
</head>
<body>
    
</body>
</html>